package andanyoung.springcloud.user.controller;

import andanyoung.springcloud.user.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @Autowired
    OrderService orderService;

    @GetMapping("/sayHello/{name}")
    public String sayHello(@PathVariable String name) {
        return "Hello ," + name;
    }

    @GetMapping("/order")
    public String order() {
        return orderService.getOrder(110);
    }

    @GetMapping("/failure")
    public String failureOrder() {
        return orderService.getFailureOrder(110);
    }
}
